<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: aruntime/src/main/java/nars/entity/TruthValue.java Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('de/de7/TruthValue_8java_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">TruthValue.java</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../de/de7/TruthValue_8java.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * TruthValue.java</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2008  Pei Wang</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * This file is part of Open-NARS.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * Open-NARS is free software; you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * the Free Software Foundation, either version 2 of the License, or</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * Open-NARS is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * along with Open-NARS.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">package </span>nars.entity;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">import</span> <a class="code" href="../../d7/d81/namespacenars.html">nars</a>.<a class="code" href="../../db/d64/namespacenars_1_1io.html">io</a>.<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols.html">Symbols</a>;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">   28</a></span>&#160;<span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">TruthValue</a> <span class="keyword">implements</span> Cloneable { <span class="comment">// implements Cloneable {</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae8b0a0c278baaac63f6a637289c6af3b.html#ae8b0a0c278baaac63f6a637289c6af3b">   30</a></span>&#160;<span class="comment"></span>    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keywordtype">char</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae8b0a0c278baaac63f6a637289c6af3b.html#ae8b0a0c278baaac63f6a637289c6af3b">DELIMITER</a> = <a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols.html">Symbols</a>.<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a1487df93cb7e583ecaec1f9b8a7941cd.html#a1487df93cb7e583ecaec1f9b8a7941cd">TRUTH_VALUE_MARK</a>;</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae51f6289a490fd2000b550e5b555e4bd.html#ae51f6289a490fd2000b550e5b555e4bd">   32</a></span>&#160;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keywordtype">char</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae51f6289a490fd2000b550e5b555e4bd.html#ae51f6289a490fd2000b550e5b555e4bd">SEPARATOR</a> = <a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols.html">Symbols</a>.<a class="code" href="../../dc/d71/classnars_1_1io_1_1Symbols_a303071a44dc2adfc5d1b0a51058b9eb4.html#a303071a44dc2adfc5d1b0a51058b9eb4">VALUE_SEPARATOR</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aca513066f9c679ba348d38af3e825671.html#aca513066f9c679ba348d38af3e825671">   34</a></span>&#160;    <span class="keyword">private</span> Float <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aca513066f9c679ba348d38af3e825671.html#aca513066f9c679ba348d38af3e825671">frequency</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a3376ba1537783e3414f3c27fb6ea398f.html#a3376ba1537783e3414f3c27fb6ea398f">   36</a></span>&#160;    <span class="keyword">private</span> Float <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a3376ba1537783e3414f3c27fb6ea398f.html#a3376ba1537783e3414f3c27fb6ea398f">confidence</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a1ad29ea07268c08f81698731432c88b3.html#a1ad29ea07268c08f81698731432c88b3">   43</a></span>&#160;    <span class="keyword">public</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a1ad29ea07268c08f81698731432c88b3.html#a1ad29ea07268c08f81698731432c88b3">TruthValue</a>(<span class="keywordtype">float</span> f, <span class="keywordtype">float</span> c) {</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        frequency = f;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        confidence = (c &lt; 1) ? <span class="keyword">new</span> Float(c) : <span class="keyword">new</span> Float(0.9999f);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    }</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a7c9890f941cbdefe87102ad76d887a38.html#a7c9890f941cbdefe87102ad76d887a38">   52</a></span>&#160;    <span class="keyword">public</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a7c9890f941cbdefe87102ad76d887a38.html#a7c9890f941cbdefe87102ad76d887a38">TruthValue</a>(<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">TruthValue</a> v) {</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        frequency = v.<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">getFrequency</a>();</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        confidence = v.<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">getConfidence</a>();</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">   61</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">float</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">getFrequency</a>() {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aca513066f9c679ba348d38af3e825671.html#aca513066f9c679ba348d38af3e825671">frequency</a> ;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    }</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">   69</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">float</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">getConfidence</a>() {</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a3376ba1537783e3414f3c27fb6ea398f.html#a3376ba1537783e3414f3c27fb6ea398f">confidence</a> ;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    }</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216.html#aa5ffcde3ae611b087ba7fdd4cd67b216">   77</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">float</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216.html#aa5ffcde3ae611b087ba7fdd4cd67b216">getExpectation</a>() {</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordflow">return</span> (<span class="keywordtype">float</span>) (confidence * (frequency - 0.5) + 0.5);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    }</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a630c30728ee404b76262610260d0a82a.html#a630c30728ee404b76262610260d0a82a">   86</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">float</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a630c30728ee404b76262610260d0a82a.html#a630c30728ee404b76262610260d0a82a">getExpDifAbs</a>(<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">TruthValue</a> t) {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">return</span> Math.abs(<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216.html#aa5ffcde3ae611b087ba7fdd4cd67b216">getExpectation</a>() - t.<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216.html#aa5ffcde3ae611b087ba7fdd4cd67b216">getExpectation</a>());</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a6813e870e1c85f42566daaf395d5f1ee.html#a6813e870e1c85f42566daaf395d5f1ee">   94</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">boolean</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a6813e870e1c85f42566daaf395d5f1ee.html#a6813e870e1c85f42566daaf395d5f1ee">isNegative</a>() {</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">getFrequency</a>() &lt; 0.5;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    @Override</div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a6c90107ab2c878d9527d4330f08ecac8.html#a6c90107ab2c878d9527d4330f08ecac8">  104</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">boolean</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a6c90107ab2c878d9527d4330f08ecac8.html#a6c90107ab2c878d9527d4330f08ecac8">equals</a>(Object that) {</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <span class="keywordflow">return</span> ((that instanceof <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">TruthValue</a>) </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                &amp;&amp; (<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">getFrequency</a>() == ((TruthValue) that).<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">getFrequency</a>()) </div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                &amp;&amp; (<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">getConfidence</a>() == ((TruthValue) that).<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">getConfidence</a>()));</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    @Override</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a8a6a2fc1c28f3294d243dce4d3c3e968.html#a8a6a2fc1c28f3294d243dce4d3c3e968">  115</a></span>&#160;    <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a8a6a2fc1c28f3294d243dce4d3c3e968.html#a8a6a2fc1c28f3294d243dce4d3c3e968">hashCode</a>() {</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">return</span> (<span class="keywordtype">int</span>) (<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216.html#aa5ffcde3ae611b087ba7fdd4cd67b216">getExpectation</a>() * 37);</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    }</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    @Override</div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a65846ee370ea21dce97ac034fb372af8.html#a65846ee370ea21dce97ac034fb372af8">  120</a></span>&#160;    <span class="keyword">public</span> Object <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a65846ee370ea21dce97ac034fb372af8.html#a65846ee370ea21dce97ac034fb372af8">clone</a>() {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a1ad29ea07268c08f81698731432c88b3.html#a1ad29ea07268c08f81698731432c88b3">TruthValue</a>(<a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">getFrequency</a>(), <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">getConfidence</a>());</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    @Override</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aac30fa0b30fd070caa7c678da2621b68.html#aac30fa0b30fd070caa7c678da2621b68">  129</a></span>&#160;    <span class="keyword">public</span> String <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aac30fa0b30fd070caa7c678da2621b68.html#aac30fa0b30fd070caa7c678da2621b68">toString</a>() {</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        <span class="keywordflow">return</span> DELIMITER + frequency.toString() + SEPARATOR + confidence.toString() + <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae8b0a0c278baaac63f6a637289c6af3b.html#ae8b0a0c278baaac63f6a637289c6af3b">DELIMITER</a>;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    }</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a5af8b2fe37987ba1e8396ec1aad38e90.html#a5af8b2fe37987ba1e8396ec1aad38e90">  137</a></span>&#160;    <span class="keyword">public</span> String <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a5af8b2fe37987ba1e8396ec1aad38e90.html#a5af8b2fe37987ba1e8396ec1aad38e90">toStringBrief</a>() {</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        String s1 = <span class="stringliteral">&quot;&quot;</span> +DELIMITER + frequency + <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae51f6289a490fd2000b550e5b555e4bd.html#ae51f6289a490fd2000b550e5b555e4bd">SEPARATOR</a>;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        Float s2 = <a class="code" href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a3376ba1537783e3414f3c27fb6ea398f.html#a3376ba1537783e3414f3c27fb6ea398f">confidence</a>;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordflow">return</span> s2 == (1.0f) ? s1 + <span class="stringliteral">&quot;0.99&quot;</span> + DELIMITER : s1 + s2 + DELIMITER;</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    }</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;}</div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a7c9890f941cbdefe87102ad76d887a38_html_a7c9890f941cbdefe87102ad76d887a38"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a7c9890f941cbdefe87102ad76d887a38.html#a7c9890f941cbdefe87102ad76d887a38">nars.entity.TruthValue.TruthValue</a></div><div class="ttdeci">TruthValue(TruthValue v)</div><div class="ttdoc">Constructor with a TruthValue to clone. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00052">TruthValue.java:52</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61_html_a9eac33f2495441c77911a8581a5bbe61"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a9eac33f2495441c77911a8581a5bbe61.html#a9eac33f2495441c77911a8581a5bbe61">nars.entity.TruthValue.getFrequency</a></div><div class="ttdeci">float getFrequency()</div><div class="ttdoc">Get the frequency value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00061">TruthValue.java:61</a></div></div>
<div class="ttc" id="namespacenars_1_1io_html"><div class="ttname"><a href="../../db/d64/namespacenars_1_1io.html">nars.io</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d3/d26/ExperienceReader_8java_source.html#l00021">ExperienceReader.java:21</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a6c90107ab2c878d9527d4330f08ecac8_html_a6c90107ab2c878d9527d4330f08ecac8"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a6c90107ab2c878d9527d4330f08ecac8.html#a6c90107ab2c878d9527d4330f08ecac8">nars.entity.TruthValue.equals</a></div><div class="ttdeci">boolean equals(Object that)</div><div class="ttdoc">Compare two truth values. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00104">TruthValue.java:104</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a1ad29ea07268c08f81698731432c88b3_html_a1ad29ea07268c08f81698731432c88b3"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a1ad29ea07268c08f81698731432c88b3.html#a1ad29ea07268c08f81698731432c88b3">nars.entity.TruthValue.TruthValue</a></div><div class="ttdeci">TruthValue(float f, float c)</div><div class="ttdoc">Constructor with two ShortFloats. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00043">TruthValue.java:43</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a303071a44dc2adfc5d1b0a51058b9eb4_html_a303071a44dc2adfc5d1b0a51058b9eb4"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a303071a44dc2adfc5d1b0a51058b9eb4.html#a303071a44dc2adfc5d1b0a51058b9eb4">nars.io.Symbols.VALUE_SEPARATOR</a></div><div class="ttdeci">static final char VALUE_SEPARATOR</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00040">Symbols.java:40</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a630c30728ee404b76262610260d0a82a_html_a630c30728ee404b76262610260d0a82a"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a630c30728ee404b76262610260d0a82a.html#a630c30728ee404b76262610260d0a82a">nars.entity.TruthValue.getExpDifAbs</a></div><div class="ttdeci">float getExpDifAbs(TruthValue t)</div><div class="ttdoc">Calculate the absolute difference of the expectation value and that of a given truth value...</div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00086">TruthValue.java:86</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_html"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols.html">nars.io.Symbols</a></div><div class="ttdoc">The ASCII symbols used in I/O. </div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00026">Symbols.java:26</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_ae8b0a0c278baaac63f6a637289c6af3b_html_ae8b0a0c278baaac63f6a637289c6af3b"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae8b0a0c278baaac63f6a637289c6af3b.html#ae8b0a0c278baaac63f6a637289c6af3b">nars.entity.TruthValue.DELIMITER</a></div><div class="ttdeci">static final char DELIMITER</div><div class="ttdoc">The charactor that marks the two ends of a truth value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00030">TruthValue.java:30</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a65846ee370ea21dce97ac034fb372af8_html_a65846ee370ea21dce97ac034fb372af8"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a65846ee370ea21dce97ac034fb372af8.html#a65846ee370ea21dce97ac034fb372af8">nars.entity.TruthValue.clone</a></div><div class="ttdeci">Object clone()</div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00120">TruthValue.java:120</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_aac30fa0b30fd070caa7c678da2621b68_html_aac30fa0b30fd070caa7c678da2621b68"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aac30fa0b30fd070caa7c678da2621b68.html#aac30fa0b30fd070caa7c678da2621b68">nars.entity.TruthValue.toString</a></div><div class="ttdeci">String toString()</div><div class="ttdoc">The String representation of a TruthValue. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00129">TruthValue.java:129</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216_html_aa5ffcde3ae611b087ba7fdd4cd67b216"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aa5ffcde3ae611b087ba7fdd4cd67b216.html#aa5ffcde3ae611b087ba7fdd4cd67b216">nars.entity.TruthValue.getExpectation</a></div><div class="ttdeci">float getExpectation()</div><div class="ttdoc">Calculate the expectation value of the truth value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00077">TruthValue.java:77</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a8a6a2fc1c28f3294d243dce4d3c3e968_html_a8a6a2fc1c28f3294d243dce4d3c3e968"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a8a6a2fc1c28f3294d243dce4d3c3e968.html#a8a6a2fc1c28f3294d243dce4d3c3e968">nars.entity.TruthValue.hashCode</a></div><div class="ttdeci">int hashCode()</div><div class="ttdoc">The hash code of a TruthValue. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00115">TruthValue.java:115</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_ae51f6289a490fd2000b550e5b555e4bd_html_ae51f6289a490fd2000b550e5b555e4bd"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_ae51f6289a490fd2000b550e5b555e4bd.html#ae51f6289a490fd2000b550e5b555e4bd">nars.entity.TruthValue.SEPARATOR</a></div><div class="ttdeci">static final char SEPARATOR</div><div class="ttdoc">The charactor that separates the factors in a truth value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00032">TruthValue.java:32</a></div></div>
<div class="ttc" id="namespacenars_html"><div class="ttname"><a href="../../d7/d81/namespacenars.html">nars</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_html"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue.html">nars.entity.TruthValue</a></div><div class="ttdoc">Frequency and confidence. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00028">TruthValue.java:28</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a6813e870e1c85f42566daaf395d5f1ee_html_a6813e870e1c85f42566daaf395d5f1ee"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a6813e870e1c85f42566daaf395d5f1ee.html#a6813e870e1c85f42566daaf395d5f1ee">nars.entity.TruthValue.isNegative</a></div><div class="ttdeci">boolean isNegative()</div><div class="ttdoc">Check if the truth value is negative. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00094">TruthValue.java:94</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_aca513066f9c679ba348d38af3e825671_html_aca513066f9c679ba348d38af3e825671"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_aca513066f9c679ba348d38af3e825671.html#aca513066f9c679ba348d38af3e825671">nars.entity.TruthValue.frequency</a></div><div class="ttdeci">Float frequency</div><div class="ttdoc">The frequency factor of the truth value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00034">TruthValue.java:34</a></div></div>
<div class="ttc" id="classnars_1_1io_1_1Symbols_a1487df93cb7e583ecaec1f9b8a7941cd_html_a1487df93cb7e583ecaec1f9b8a7941cd"><div class="ttname"><a href="../../dc/d71/classnars_1_1io_1_1Symbols_a1487df93cb7e583ecaec1f9b8a7941cd.html#a1487df93cb7e583ecaec1f9b8a7941cd">nars.io.Symbols.TRUTH_VALUE_MARK</a></div><div class="ttdeci">static final char TRUTH_VALUE_MARK</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/da0/Symbols_8java_source.html#l00039">Symbols.java:39</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a5af8b2fe37987ba1e8396ec1aad38e90_html_a5af8b2fe37987ba1e8396ec1aad38e90"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a5af8b2fe37987ba1e8396ec1aad38e90.html#a5af8b2fe37987ba1e8396ec1aad38e90">nars.entity.TruthValue.toStringBrief</a></div><div class="ttdeci">String toStringBrief()</div><div class="ttdoc">A simplified String representation of a TruthValue, where each factor is accruate to 1%...</div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00137">TruthValue.java:137</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c_html_a68ca7d92e9ea20d2a9a9f578ad7b681c"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a68ca7d92e9ea20d2a9a9f578ad7b681c.html#a68ca7d92e9ea20d2a9a9f578ad7b681c">nars.entity.TruthValue.getConfidence</a></div><div class="ttdeci">float getConfidence()</div><div class="ttdoc">Get the confidence value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00069">TruthValue.java:69</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TruthValue_a3376ba1537783e3414f3c27fb6ea398f_html_a3376ba1537783e3414f3c27fb6ea398f"><div class="ttname"><a href="../../d3/db8/classnars_1_1entity_1_1TruthValue_a3376ba1537783e3414f3c27fb6ea398f.html#a3376ba1537783e3414f3c27fb6ea398f">nars.entity.TruthValue.confidence</a></div><div class="ttdeci">Float confidence</div><div class="ttdoc">The confidence factor of the truth value. </div><div class="ttdef"><b>Definition:</b> <a href="../../de/de7/TruthValue_8java_source.html#l00036">TruthValue.java:36</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_ed82ebcd34e530b246c6fd9032262140.html">aruntime</a></li><li class="navelem"><a class="el" href="../../dir_19496ddff8e6c0f2b6654287ecb1a472.html">src</a></li><li class="navelem"><a class="el" href="../../dir_db9c5934f797909f7296c2c2017f7fc9.html">main</a></li><li class="navelem"><a class="el" href="../../dir_6d74390eb6d6287951075e525bcb9bed.html">java</a></li><li class="navelem"><a class="el" href="../../dir_51a24984472456d47100350cd31f9a7c.html">nars</a></li><li class="navelem"><a class="el" href="../../dir_c3c9ea9f52870ae82b0fae20af0d9479.html">entity</a></li><li class="navelem"><a class="el" href="../../de/de7/TruthValue_8java.html">TruthValue.java</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:58 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
